function instanceOf(obj, instance) {
    let p = obj.__proto__;
    let res = false;
    while (p) {
        if (p === instance.prototype) {
            res = true
        }
        p = p.__proto__;
    }
    console.log(res)
    return res
}

instanceOf([1, 2], Object)